<?php
namespace app\wxapi\controller;

use app\index\model\Bannermodel;
use app\wxapi\model\Contentmodel;
use think\App;

class Index extends Common
{
    protected $bannermodel;
    protected $contentmodel;

    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->bannermodel = new Bannermodel();
        $this->contentmodel = new Contentmodel();
    }

    public function index(){
        //获取banner图
		$this->showData['bannerList'] = $this->bannermodel->findAllInfo('title, img', [['status', '=', 1], ['cid', '=', 28]], ['order'=>'desc', 'id'=>'desc']);
        $articleList = $this->contentmodel->findAll([['a.status', '=', 1], ['a.type', '=', 5], ['a.examine_status', '=', 9]], $this->request->param());
        $this->showData['articleList'] = $articleList['data'];
		
		return json(['code'=>200, 'result'=>'success', 'data'=>$this->showData]);
	}
}
